<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/_fragments :: head('标签管理')"></head>
<body class="m-opacity-mini">

  <!--导航-->
  <nav th:replace="admin/_fragments :: nav(3)" ></nav>


  <!--中间内容-->
  <div  class="m-container-small m-padded-tb-big">
    <div class="ui container">
      <div class="ui message" th:unless="${#strings.isEmpty(tagMsg)}">
        <i class="close icon"></i>
        <div class="header">提示：</div>
        <p th:text="${tagMsg}"></p>
      </div>
      <table class="ui celled table">
        <thead>
          <tr>
            <th></th>
            <th>标签名称</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr th:each="tag,iterStat : ${pageInfo.list}">
            <td th:text="${iterStat.count}"></td>
            <td th:text="${tag.name}"></td>
            <td>
              <a href="#" th:href="@{/admin/tags/{id}/toUpdate(id=${tag.id})}" class="ui mini teal basic button">编辑</a>
              <a th:href="@{/admin/tags/{id}/delete(id=${tag.id})}" class="ui mini red basic button">删除</a>
            </td>
          </tr>
        </tbody>
        <tfoot>
          <tr>
            <th colspan="6">
              <div class="ui mini pagination menu">
                <!-- th:href="@{/admin/tyes/${type.pageNum}+1" -->
                <a th:href="@{/admin/tags(pageNum=${pageInfo.pageNum}-1)}" class=" item" th:if="${pageInfo.hasPreviousPage}">上一页</a>
                <a th:href="@{/admin/tags(pageNum=${pageInfo.pageNum}+1)}" class=" item" th:if="${pageInfo.hasNextPage}">下一页</a>
              </div>
              <a th:href="@{/admin/tags/addTag}" class="ui mini right floated teal basic button">新增</a>
            </th>
          </tr>
        </tfoot>
      </table>
    </div>
  </div>

  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <!--底部footer-->
  <footer th:replace="admin/_fragments :: footer"></footer>


  <!--导入的script-->
  <th:block th:replace="admin/_fragments :: script">
  </th:block>

  <script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
      on : 'hover'
    });

    // 消息提示可关闭
    $('.message .close').on('click', function() {
        $(this)
                .closest('.message')
                .transition('fade')
        ;
      })
    ;


  </script>
</body>
</html>